package com.linkhub.oms.data.sync.api.yunexpress.client;

import com.dtflys.forest.annotation.*;
import com.dtflys.forest.http.ForestResponse;
import com.linkhub.oms.data.sync.api.yunexpress.domain.request.CreateOrderRequest;
import com.linkhub.oms.data.sync.api.yunexpress.domain.request.GetTrackingNumberRequest;
import com.linkhub.oms.data.sync.api.yunexpress.domain.request.InterceptRequest;
import com.linkhub.oms.data.sync.api.yunexpress.domain.request.PriceTrialRequest;
import com.linkhub.oms.data.sync.api.yunexpress.domain.response.*;

import java.util.List;

/**
 * @Description: OMSYunExpressClient
 * @Author: echo
 * @Date: 2024/5/25 16:34
 * @Version: 1.0
 */
@BaseRequest(
        baseURL = "#{oms-yunexpress.apiUrl}",
        headers = {
                "Authorization: #{oms-yunexpress.authorization}",
                "Accept: application/json"
        }
)
public interface OMSYunExpressClient {


    @Get("/api/Freight/GetPriceTrial")
    ForestResponse<PriceTrialResponse> getPriceTrial(@Query PriceTrialRequest request);

    @Post("/api/WayBill/Intercept")
    ForestResponse<InterceptResponse> intercept( @JSONBody InterceptRequest request );

    @Post("/api/WayBill/CreateOrder")
    ForestResponse<CreateOrderResponse> createOrder( @JSONBody List<CreateOrderRequest> request );

    @Post("/api/Label/Print")
    ForestResponse<PrintOrderResponse> printOrder( @JSONBody List<String> request );

    @Get("/api/Waybill/GetTrackingNumber")
    ForestResponse<GetTrackingNumberResponse> getTrackingNumber( @Query GetTrackingNumberRequest request);

    @Get("/api/WayBill/GetOrder")
    ForestResponse<GetOrderResponse> getOrder( @Query("OrderNumber") String requests );
}
